Copyright: Copyright ® 1996 Softouch Development Inc.


Contents

The following Help Topics are available:

General Overview

Installation

TIncCombo Component

TDBIncCombo Component

TDBIncLookupCombo Component

TDBIncSearchCombo Component

Grid Support

Support and Upgrades

Ordering Information

Return Policy

License Agreement

History

Copyright © 1996 Softouch Development Inc.  All rights reserved.

CIS:102565,2117 or 102565.2117@compuserve.com

http://ourworld.compuserve.com/homepages/softouchdev


General Overview

This set contains four incremental combo boxes that we believe to be the most advanced incremental combo boxes on the market today for Delphi.  These controls are the only incremental controls on the market today that support TQuery in both 16 and 32bit and will automatically place themselves within a Borland or InfoPower database grid.

The Controls

*  TIncCombo - This control is a replacement for TComboBox.

*  TDBIncCombo - This control is a data-aware combo box that replaces TDBComboBox.

*  TDBIncLookupCombo - This control is a data-aware lookup combo box replacement for  TDBLookupCombo and TDBLookupComboBox.

*  TDBIncSearchCombo - This control is a navigational combo box for doing dataset navigation.

All the controls possess the following features.

*  Quicken style incremental lookups that automatically complete the text.

*  Sorted or non-sorted lookup lists.

*  Ability to hide the combo button under certain conditions. ShowComboButton property.

*  Customizable drop down options including alignment and cursor properties. DropDownOptions property.

*  Add new items on the fly.  OnNewItem event and OnNewRecord event.

*  Ability to change the border style.

*  Ability to specify the Button cursor.  ButtonCursor property.

*  Ability to accept blank values.  CanBeBlank property.  This does not apply to the TDBIncSearchCombo.

*  Ability to drop down the list under different conditions like when the control get focus or when the text is changed.  AutoDropDown property.

Other Features.

*  Automatically work in Borlands TDBGrid and InfoPowers TwwDBGrid. GridParent property.

*  Fully supports TQuery in 16 and 32 bit.  LookupSource property.

*  Borlands TDBCtrlGrid support.

*  Can search on number or right justified text. ExtendedSearch property.

*  Range support.

*  Independent indexes for the drop down grid, DataField lookups (LinkIndex), and incremental searching (LookupIndex).


TIncCombo Component

Properties          Methods         Events

Unit

IncCombo

Description

The TIncCombo component is the most basic of the Combo Collection.  This component is equivalent to Delphis standard combo box with the exception of its incremental properties.

In addition to these properties, methods, and events, this component also has the properties, methods, and events that apply to all windowed controls.


Properties

Run-Time only

	AutoDropDown		DragMode		MaxLength		ShowHint
	AutoSize		DropDownOptions		Name		Style
	BorderStyle		Enabled		ParentColor		TabOrder
	ButtonCursor		Font		ParentCtl3D		TabStop
	CanBeBlank		Found		ParentFont		Tag
	CharCase		Height		ParentShowHint		Top
	Color		HelpContext		PopupMenu		Visible
	ComboButtonVisible		Hint		ReadOnly		VisibleRows
	Ctl3D		ItemIndex		SearchResult		Width
	Cursor		Items		SearchText
	DragCursor		Left		ShowComboButton


Methods

	CanDropDown	Destroy
	CanModify	DropDown
	CloseUp	DropDownList
	Create	FloatOverGrid


Events

	OnChange		OnDragDrop		OnEnter		OnKeyUp
	OnClick		OnDragOver		OnExit		OnMouseDown
	OnCloseUp		OnDropDown		OnKeyDown		OnMouseUp
	OnDblClick		OnEndDrag		OnKeyPress		OnNewItem


License Agreement

Grant of License for evaluators of this software product. Evaluator is granted the right to evaluate the shareware version of this software product and to distribute the unmodified shareware files to others, at no cost, for evaluation purposes only.

Grant of License for purchased software products.  Purchaser is granted the right to create and distribute executable files using this software product royalty free.  Purchaser may not distribute any version of this software product whether it be the original software product or a modified version thereof except as provided by above.

EVALUATOR OR PURCHASER ASSUMES ALL RESPONSIBILITIES AND RISKS ASSOCIATED WITH THE USE OF THE THIS SOFTWARE  PRODUCT.  THE AUTHORS OF THIS SOFTWARE PRODUCT ASSUME NO RESPONSIBILITY OR LIABILITY BEYOND THE COST OF THE COMPONENT FOR ANY ACTIONS ASSOCIATED WITH THIS SOFTWARE PRODUCT.

IF YOU DO NOT AGREE WITH ANY OF THE TERMS LISTED, PLEASE

RETURN THE SOFTWARE PRODUCT IMMEDIATELY FOR A REFUND.


Support and Upgrades

Registration of the Incremental Combo Collection entitles the purchaser to 30 days of free support via Compuserve and 6 months of free upgrades.  Beyond the initial 30 day period, submission of bugs are always welcome and we will do are best to respond back to them in a reasonable amount of time.


Ordering Information

Price is $59 U.S with source.

For your convenience we currently have three methods for ordering our products.

1) The first method is through Compuserves 'SWREG' forum.

GO SWREG and search for Keyword 'IncCombo' or Author's User ID '102565,2117'.

2) The second method is via a North Star Solutions using your Visa or MasterCard. They may be contacted for orders only via any of the following methods.

Voice:

   1-800-699-6395 (10:00 a.m. - 10:00 p.m.., EST. Calls from the U.S. only.)

   1-803-699-6395 (10:00 a.m. - 10:00 p.m.., EST)

Fax:

   1-800-699-5465 (Available 24 hours, International and business orders encouraged)

E-Mail:

   America Online: STARMAIL

   Compuserve: 71561,2751

   Internet: STARMAIL@AOL.COM

IMPORTANT NOTES: NorthStar processes registrations only. Please contact us at 102565.2117@compuserve.com for any product or technical support.

 3) The third method is through the mail using a check or money order. Our address is as follows.

Softouch Development Inc.

12320 S.W. 128 Street

Tigard, Oregon 97223

Please specify the media size, either 5.25 or 3.5 inch floppy and the mailing address you would like the product shipped to. When possible, orders will be directly E-Mailed to you.


Return Policy

As always, our components come with a 30 day money back guarantee.


AutoDropDown Property

Applies to

TIncCombo, TDBIncCombo, TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  property AutoDropDown: TAutoDropDown;

Description

AutoDropDown lets you determine at what point the drop down list will automatically drop down.


TAutoDropDown Type

Unit

IncBase

Declaration

type

  TAutoDropDown = (adNever, adFocused, adChanged);

Description

The TAutoDropDown type defines the possible values for the AutoDropDown property of the TIncCombo, TDBIncCombo, TDBIncLookupCombo, TDBIncSearchCombo components, as described in the following table:

Value	Description
adNever	The drop down list will never automatically drop down.
AdFocused	The drop down list will drop down when the control gets focus.
AdChanged	The drop down list will drop down when the text is changed.


ButtonCursor Property

Applies to

TIncCombo, TDBIncCombo, TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  property ButtonCursor: TCursor;

Description

The ButtonCursor property is the image used when the mouse passes over the controls combo button.


ComboButtonVisible Property

Applies to

TIncCombo, TDBIncCombo, TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  property ComboButtonVisible: Boolean;

Description

Run-time and read only, the ComboButtonVisible property is used to determine if the combo button is actually visible at any given time.


SearchResult Property

Applies to

TIncCombo, TDBIncCombo, TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  property SearchResult: String;

Description

Run-time and read only, the SearchResult property is the actually text value found within the dataset or list.


SearchText Property

Applies to

TIncCombo, TDBIncCombo, TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  property SearchText: String;

Description

Run-time and read only, the SearchText property is the text value used for searching.


ShowComboButton Property

Applies to

TIncCombo, TDBIncCombo, TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  property ShowComboButton: TShowComboButton;

Description

The ShowComboButton property is used to determine when the combo button will be visible.


TShowComboButton Type

Unit

IncBase

Declaration

type

  TShowComboButton = (scNever, scAlways, scFocused);

Description

The TShowComboButton type defines the possible values for the ShowComboButton property of the TIncCombo, TDBIncCombo, TDBIncLookupCombo, TDBIncSearchCombo components, as described in the following table:

Value	Description
scNever	The combo button will never be visible.
scAlways	The combo button will always be visible.
scFocused	The combo button will be visible when the control gets focus.


Style Property

Applies to

TIncCombo, TDBIncCombo, TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  property Style: TComboStyle;

Description

The Style property is used to determine what type of combo box this control is and how it will function.


VisibleRows Property

Applies to

TIncCombo, TDBIncCombo, TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  property VisibleRows: Integer;

Description

Run-time and read only, the VisibleRows property is used to determine the number of visible rows within the drop down list.  To change the number of rows that appear within the drop down list, set the MaxRows property within the DropDownOptions property for this control.  The only time MaxRows will not equal VisibleRows is when the drop down list is not visible or the items within the drop down list are less then MaxRows.  If the list is not visible, VisibleRows will equal 0.


TComboStyle Type

Unit

IncBase

Declaration

type

 TComboStyle = (csIncSearch, csIncSearchEdit);

Description

The TComboStyle type defines the possible values for the Style property of the TIncCombo, TDBIncCombo, TDBIncLookupCombo, TDBIncSearchCombo components, as described in the following table:

Value	Description
csIncSearch	Only values within the drop down list are valid values.
CsIncSearchEdit	New values can be entered.


TDBIncCombo Component

Properties          Methods         Events

Unit

IncDBCmb

Description

The TDBIncCombo component is a Combo Box with data-aware capabilities.  It uses a standard single column drop down list whos items can be changed through the Items property.

This component is equivalent to Delphis standard data-aware combo box with the exception of its incremental properties and its ability to automatically place itself within a Borland DBGrid or an InfoPower TwwDBGrid. See GridParent property.

In addition to these properties, methods, and events, this component also has the properties, methods, and events that apply to all windowed controls.


TDBIncCombo Properties
Properties

Run-Time only

	AutoDropDown		DragCursor		Left		ShowHint
	AutoSize		DragMode		MaxLength		Style
	BorderStyle		DropDownOptions		Name		TabOrder
	ButtonCursor		Enabled		ParentColor		TabStop
	CanBeBlank		Font		ParentCtl3D		Tag
	CharCase		Found		ParentFont		Top
	Color		GridParent		ParentShowHint		Visible
	ComboButtonVisible		Height		PopupMenu		VisibleRows
	Ctl3D		HelpContext		ReadOnly		Width
	Cursor		Hint		SearchResult
	DataField		ItemIndex		SearchText
	DataSource		Items		ShowComboButton


ItemIndex Property

Applies to

TIncCombo, TDBIncCombo components

Declaration

  property ItemIndex: Integer;

Description

Run-time only.  The value of the ItemIndex property is the ordinal number of the selected item in the control's items property. If no item is selected, the value is -1.  To select an item at run time, set the value of ItemIndex to the index of the item in the list you want selected, with 0 being the first item in the drop down list.


Items Property

Applies to

TIncCombo, TDBIncCombo components

Declaration

 property Items: TStrings;

Description

The Items property contains the strings that appear in the drop down list box.  Because Items is an object of type TStrings, you can add, delete, insert, and move items using the Add, Delete, Insert, Exchange, and Move methods of the TStrings object.

The ItemIndex property determines which item is selected, if any.


Found Property

Applies to

TIncCombo, TDBIncCombo, TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  property Found: Boolean;

Description

The Found property is used to determine if the actual text for the combo box exist in the drop down list.


CanDropDown Method

Applies to

TIncCombo, TDBIncCombo, TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  function CanDropDown: Boolean;

Description

The CanDropDown method determines whether this control can drop down its list box.


CanModify Method

Applies to

TIncCombo, TDBIncCombo, TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  function CanModify: Boolean;

Description

The CanModify method determines whether this controls text value can be edited.


CloseUp Method

Applies to

TIncCombo, TDBIncCombo, TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  procedure CloseUp;

Description

The CloseUp method causes the drop down list for this control to close up and hide.


DropDown Method

Applies to

TIncCombo, TDBIncCombo, TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  procedure DropDown(State: TDropDownState);

Description

The DropDown method causes the drop down list for this control to drop down and become visible.


DropDownList Method

Applies to

TIncCombo, TDBIncCombo, TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  function DropDownList: TIncGridWinControl;

Description

The DropDownList method returns a pointer to the actual drop down list.  For TIncCombo and TDBIncCombo, this would be a TCustomListBox.  For TDBIncLookupCombo and TDBIncSearchCombo, this would be a TCustomDBGrid.


TIncGridWinControl Type

Unit

IncBase

Declaration

type

 TIncGridWinControl = class(TWinControl)

Description

The TIncGridWinControl type defines an object declaration of type TWinControl with the exception of exposing the Color and Font property.  This type is used to define the return value for  the DropDownList method.


OnNewItem Event

Applies to

TIncCombo, TDBIncCombo components

Declaration

 property OnNewItem: TNewItemEvent;

Description

The OnNewItem event gets called whenever a new item is typed into the combo box that does not exist in the list.  It is up to the user, within this event, to add the new item to the Items property or abort from this event.

If for any reason, you decide not to update the items property, you must abort from this event.  If you do not have this event assigned, and a new item needs to be added, the control will abort the addition automatically and revert the text back to its original value.


TNewItemEvent Type

Unit

IncCombo

Declaration

type

 TNewItemEvent = procedure(Sender: TCustomIncListBoxCombo) of object;

Description

The TNewItemEvent type defines the event type for when a new items is type into a combo box for either a TIncCombo or a TDBIncCombo component.


DropDownOptions Property

Applies to

TIncCombo, TDBIncCombo, TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

For TIncCombo, TDBIncCombo

  property DropDownOptions: TListBoxOptions;

For TDBIncLookupCombo, TDBIncSearchCombo

  property DropDownOptions: TDBListBoxOptions

Description

The DropDownOptions property is an object that defines the attributes of the drop down list box.


TListBoxOptions Object

Properties

Unit

IncCombo

Description

The TListBoxOptions object defines the attributes of the drop down list box for a TIncCombo or a TDBIncCombo DropDownOptions property


Properties

	AlignHorizontally		MaxRows
	AlignVertically		ParentColor
	Color		ParentCtl3D
	Ctl3D		ParentFont
	Cursor		Sorted
	Font		Width


AlignHorizontally Property

Applies to

TListBoxOptions object for TIncCombo, TDBIncCombo components and the TDBDropDownOptions object for TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  property AlignHorizontally: TDropDownAlignHorizontally;

Description

The AlignHorizontally property defines where the drop down list drops down horizontally in respect to its edit box.


TDropDownAlignHorizontally Type

Unit

IncBase

Declaration

type

 TDropDownAlignHorizontally = (daLeft,daRight);

Description

The TDropDownAlignHorizontally type defines the possible values for the AlignHorizontally property of the TListBoxOptions object for TIncCombo, TDBIncCombo components, and the TDBDropDownOptions object for TDBIncLookupCombo, TDBIncSearchCombo components, as described in the following table:

Value	Description
daLeft	Align drop down list to the left side of the combo boxes edit field.
daRight	Align drop down list to the right side of the combo boxes edit field.


AlignVertically Property

Applies to

TListBoxOptions object for TIncCombo, TDBIncCombo components and the TDBDropDownOptions object for TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  property AlignVertically: TDropDownAlignVertically;

Description

The AlignVertically property defines where the drop down list drops down vertically in respect to its edit box


TDropDownAlignVertically Type

Unit

IncBase

Declaration

type

 TDropDownAlignVertically = (daTop,daBottom);

Description

The TDropDownAlignVertically type defines the possible values for the AlignVertically property of the TListBoxOptions object for TIncCombo, TDBIncCombo components, and the TDBDropDownOptions object for TDBIncLookupCombo, TDBIncSearchCombo components, as described in the following table:

Value	Description
daTop	Drop down list will appear above the combo boxes edit field.
daBottom	Drop down list will drop down below the combo boxes edit field.


MaxRows Property

Applies to

TListBoxOptions object for TIncCombo, TDBIncCombo components and the TDBDropDownOptions object for TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  property MaxRows: Integer;

Description

The MaxRows property defines how many rows can be displayed within the drop down list.  If the items within the drop down list are less the MaxRows then the rows displayed will not equal MaxRows.  To get the actual row count of the drop down list, use the VisibleRows property.


DataField Property

Applies to

TDBIncCombo, TDBIncLookupCombo components

Declaration

  property DataField: String;

Description

For TDBIncCombo, the DataField property identifies the field from which the data-aware control displays data.

For TDBIncLookupComb, the DataField property identifies the field from which the data-aware control uses to link to the LinkField property.  The DataField in this instance is not the display value.  The display value is determined by the LookupDisplay property.

The DataSource property determines where the component obtains the data.


DataSource Property

Applies to

TDBIncCombo, TDBIncLookupCombo components

Declaration

  property DataSource: TDataSource;

Description

The DataSource property determines where the component obtains the data. Specify the data source component that identifies the dataset the data is found in.  This field works in conjunction with DataField.


TDBIncLookupCombo Component

Properties          Method        Events

Unit

IncDBLup

Description

The TDBIncLookupCombo component is a combo box with data-aware capabilities that builds it lookup list from another dataset.   This component is equivalent to Delphis standard data-aware lookup combo box with the exception of its incremental properties and its ability to automatically place itself within a Borland DBGrid or an InfoPower TwwDBGrid. See GridParent property.

In addition to these properties, methods, and events, this component also has the properties, methods, and events that apply to all windowed controls.


TDBIncLookupCombo Properties
Properties

Run-Time only

	AutoDropDown		DisplayDBFld		LinkDBFld		SearchResult
	AutoSelect		DragCursor		LinkField		SearchText
	AutoSize		DragMode		LinkIndex		ShowComboButton
	AutoSync		DropDownOptions		LookupDisplay		ShowHint
	BorderStyle		Enabled		LookupIndex		Style
	ButtonCursor		ExtendedSearch		LookupSource		TabOrder
	CanBeBlank		FilteredSearch		MaxLength		TabStop
	CharCase		Font		Name		Tag
	Color		Found		ParentColor		Top
	ComboButtonVisible		GridParent		ParentCtl3D		Value
	Ctl3D		Height		ParentFont		Visible
	Cursor		HelpContext		ParentShowHint		VisibleRows
	DataField		Hint		PopupMenu		Width
	DataSource		Left		ReadOnly


AutoSync Property

Applies to

TDBIncLookupCombo component

Declaration

  property AutoSync: Boolean;

Description

The AutoSync property is used to determine if external navigation of the LookupSource dataset will cause changes to the controls values.  The only time this property will have any effect is if the control has focus.


BufferedLookupSource Property

Applies to

TDBIncSearchCombo component

Declaration

  property BufferedLookupSource: TDataSource;

Description

Run-time and read only, the BufferedLookupSource is a pointer to the internal LookupSource used by this control.  The BufferedLookupSource is the actual datasource used for the drop down list.  This BufferedLookupSource is needed so that when the drop down list is scrolled, the LookupSource dataset position does not change.


DisplayDBFld Property

Applies to

TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  property DisplayDBFld: TField;

Description

Run-time and read only, the DisplayDBFld property is a pointer to the TField that is used as the display field for the edit box.  For the TDBIncSearchCombo, this field is located within the BufferedLookupSource.  For the TDBIncLookupCombo the field is located within the LookupSource.  The fields name is always the first field within LookupDisplay property.


ExtendedSearch Property

Applies to

TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  property ExtendedSearch: Boolean;

Description

The ExtendedSearch property, if set to True, will cause all searches to be treated as numbers and padded to right with zeros until the length of the field has been exhausted or a match is found.


LinkDBFld Property

Applies to

TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  property LinkDBFld: TField;

Description

Run-time and read only, the LinkDBFld property is a pointer to the TField that is used as the Lookup Field for the edit box.  This field is located within the BufferedLookupSource.  The fields name is always equal to the LinkField or the first field within LookupDisplay property for TDBIncSearchCombo.


LookupDisplay Property

Applies to

TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  property LookupDisplay: String;

Description

The LookupDisplay property determines which field in the lookup table displays in the database lookup combo box. Before you specify a LookupDisplay field, link the two datasets using the LinkField property.

You can choose to display multiple fields from the lookup dataset. Each field appears in a separate column. To specify more than one field to display, separate each field name with a semicolon. For example, this line of code displays three columns in the drop-down list of a database lookup combo box. Column 1 is the name of the company, column 2 is the city where the company is located, and column 3 is the country.

  DBLookupCombo1.LookupDisplay := 'Company;City;Country';

The actual edit field for the combo box will display Company and this will be the value that will get incrementally searched one when the user types in text.

Within Delphi 16Bit, LookupSource dataset must also contain an index that starts with this field.


LinkField Property

Applies to

TDBIncLookupCombo component

Declaration

  property LinkField: String;

Description

The LinkField property links the LookupSource dataset to the DataSource dataset you are working with.

Although the name of the field specified as the LinkField does not have to be the same as the name of the field specified as the DataField, the two fields must contain the same values. For example, the LinkField value can be CustomerNumber and the DataField value can be CustNo, as along as both fields use the same number to identify a particular customer.

You must either specify LinkIndex or the LookupSource dataset must also contain an index that starts with this field.

After you specify a LinkField field, you can choose which field you prefer to display in the control with the LookupDisplay property.


LookupSource Property

Applies to

TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  property LookupSource: TDataSource;

Description

The LookupSource of a database lookup combo box is the data source component (TDataSource) that identifies the dataset you want the control to use to "look up" the information you want displayed in the control.

In TDBIncLookupCombo any navigational changes to LookupSource can be reflected in the values of the control by setting AutoSync to True.

In TDBIncSearchCombo this is the datasource used to navigate the table.  Any navigational changes to LookupSource will be reflected in the values of the control.

Within Delphi 16 or 32 bit,  the LookupSource dataset can be either TTable or TQuery.


Value Property

Applies to

TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  property Value: String;

Description

Run-time and read only.

For TDBIncLookupCombo the Value property is equal to the actual value for DataField.  This value can also be obtained using the LinkDBFld property.

For TDBIncSearchCombo the Value property is equal to the actual value of the first field of LookupDisplay.  This value can also be obtained using the DisplayDBFld property.


TDBIncLookupCombo Events
Events

	OnChange		OnEnter
	OnClick		OnExit
	OnCloseUp		OnFilteredSearch
	OnCustomLocate		OnKeyDown
	OnCustomSearch		OnKeyPress
	OnCustomSearchRec		OnKeyUp
	OnDblClick		OnMouseDown
	OnDragDrop		OnMouseUp
	OnDragOver		OnNewRecord
	OnDropDown		OnValidateLocate
	OnEndDrag		OnValidateSearch


OnCustomSearch Event

Applies to

TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

 property OnCustomSearch: TSearchNotifyEvent;

Description

The OnCustomSearch event, when assigned, gets called when the control would normally do its incremental lookups.  If you assign a procedure to this event, the default searching will no longer happen.  If ExtendedSearch is set to True, this event will still only get called once for every key typed and ExtendedSearch will have no purpose.  If you would like for ExtendedSearch to still work and would still like to do custom searching, then use the OnCustomSearchRec event.

It will be up to the assigned event to set the index appropriately for the lookup.  The control will automatically reset the index after the call to this event.


OnCustomSearchRec Event

Applies to

TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

 property OnCustomSearchRec: TSearchNotifyEvent;

Description

The OnCustomSearchRec event, when assigned, gets called when the control would normally do its actual locate or lookup for the record during incremental searches. If you assign a procedure to this event, the default searching will no longer happen.  If ExtendedSearch is set to True, this event will get called multiple times for each lookup.

It will be up to the assigned event to set the index appropriately for the lookup.  The control will automatically reset the index after the call to this event.


OnNewRecord Event

Example

Applies to

TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

 property OnNewRecord: TNewRecordEvent;

Description

The OnNewRecord event gets called whenever a new item is typed into the combo box that does not exist in the list.  It is up to the user, within this event, to add the new item to the LookupSource dataset and for TDBIncLookupCombo set the datafields actual value to link appropriately with the LinkField.  This event actually gets called when the control loses focus.

If for any reason, you decide not to update the dataset, you must abort from this event.  If you do not have this event assigned, and a new item needs to be added, the control will abort the addition automatically.


TNewRecordEvent Type

Unit

IncDBSrc

Declaration

type

  TNewRecordEvent = procedure(Sender: TObject; DataSet: TDataSet; NewValue: String) of object;

Description

The TNewRecordEvent type defines the event type for when a new items is type into a combo box for either a TDBIncLookupCombo or a TDBIncSearchCombo.


TSearchNotifyEvent Type

Unit

IncDBSrc

Declaration

type

  TSearchNotifyEvent = procedure(Sender: TObject; DataSet: TDataSet; SearchText: String) of object;

Description

The TSearchNotifyEvent type defines the event type for doing custom lookups within the DataSet.  SearchText is the actual text value to search on.


TDBDropDownOptions Object

Properties

Unit

IncDBSrc

Description

The TDBDropDownOptions object defines the attributes of the drop down list box for a TDBIncLookupCombo or a TDBIncSearchCombo DropDownOptions property


TDBDropDownOptions Properties
Properties

	AlignHorizontally		ParentColor
	AlignVertically		ParentCtl3D
	ColLines		ParentFont
	Color		RowLines
	Ctl3D		TitleColor
	Cursor		TitleFont
	Font		Titles
	MaxRows		Width


ColLines Property

Applies to

TDBDropDownOptions object for TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  property ColLines: Boolean;

Description

The ColLines property defines whether or not column lines will appear in the drop down list or not.


RowLines Property

Applies to

TDBDropDownOptions object for TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  property RowLines: Boolean;

Description

The RowLines property defines whether or not row lines will appear in the drop down list or not.


TitleColor Property

Applies to

TDBDropDownOptions object for TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  property TitleColor: TColor;

Description

The TitleColor property defines the color to be used for the title of the drop down list.


TitleFont Property

Applies to

TDBDropDownOptions object for TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  property TitleFont: TFont;

Description

The TitleFont property defines the font to be used for the title of the drop down list.


Titles Property

Applies to

TDBDropDownOptions object for TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  property Titles: Boolean;

Description

The Titles property defines whether or not the drop down list will have titles or not.  Title names are taken from the LookupDisplay property.


TDBIncSearchCombo Component

Properties 	Methods	      Events

Unit

IncDBSrc

Description

The TDBIncSearchCombo is a incremental combo box used for navigating a datasource.   A the user types in a value in the edit box, the LookupSource dataset is navigated to the new location.   Likewise if the LookupSource dataset is navigated, the value in the edit box changes to match the new location.

In addition to these properties, methods, and events, this component also has the properties, methods, and events that apply to all windowed controls.


(type popup caption here)
Properties

Run-Time only

	AutoDropDown		DisplayDBFld		LookupIndex		ShowHint
	AutoInsert		DragCursor		LookupSource		Style
	AutoSelect		DragMode		MaxLength		TabOrder
	AutoSize		DropDownOptions		Name		TabStop
	AutoSuppressCancel		Enabled		ParentColor		Tag
	BorderStyle		ExtendedSearch		ParentCtl3D		Top
	BufferedLookupSource		Font		ParentFont		Value
	ButtonCursor		Found		ParentShowHint		Visible
	CharCase		Height		PopupMenu		VisibleRows
	Color		HelpContext		ReadOnly		Width
	ComboButtonVisible		Hint		SearchResult
	Ctl3D		Left		SearchText
	Cursor		LookupDisplay		ShowComboButton


AutoInsert Property

Applies to

TDBIncSearchCombo component

Declaration

  property AutoInsert: Boolean;

Description

The AutoInsert property determines if a new text value is type into the edit control if the control will place the LookupSource dataset into insert mode automatically.


AutoSuppressCancel Property

Applies to

TDBIncSearchCombo component

Declaration

  property AutoSuppressCancel: Boolean;

Description

The AutoSuppressCancel property determine if when its time to cancel changes because the control needs to lookup a new value, if the control will suppress the OnBeforeCancel event for the LookupSource dataset.  The only time this property will have any effect is when the control starts the inserting and the user has not left the controls edit field.  If the user instigates the edit or insert, the OnBeforeCancel event will not get suppressed regardless of the setting of the property.


LookupIndex Property

Applies to

TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

 property LookupIndex: String;

Description

The LookupIndex property determines the index used when doing incremental searching on the LookupSource.  This property is only valid when LookupSource dataset inherits from TTable.

NOTE:  You only need to set this field if you have some specialized indexing needs.  If left blank, the control will look for an index that starts with the first field in the LookupDisplay property.


OnCustomLocate Event

Applies to

TDBIncLookupCombo component

Declaration

property OnCustomLocate: TSearchNotifyEvent;

Description

The OnCustomLocate event, when assigned, gets called when the control would normally try to locate the LinkField using the DataField.  If you assign a procedure to this event, the default locating will no longer happen.

It will be up to the assigned event to set the index appropriately for the lookup.  The control will automatically reset the index after the call to this event.


TDBIncSearchCombo Events
Events

	OnChange		OnDblClick		OnEnter		OnMouseDown
	OnClick		OnDragDrop		OnExit		OnMouseUp
	OnCloseUp		OnDragOver		OnKeyDown		OnNewRecord
	OnCustomSearch		OnDropDown		OnKeyPress		OnValidateSearch
	OnCustomSearchRec		OnEndDrag		OnKeyUp


OnDropDown Event

Applies to

TIncCombo, TDBIncCombo, TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

property OnDropDown: TDropDownEvent;

Description

The OnDropDown event gets called right before the drop down list appears.


TDropDownEvent Type

Unit

IncBase

Declaration

type

  TDropDownEvent = procedure(Sender: TObject; State: TDropDownState) of object;

Description

The TDropDownEvent type defines the event type for when the drop down list is about to appear.  The DropDownState defines the possible reasons why the list is about to appear.


TDropDownState Type

Unit

IncBase

Declaration

type

  TDropDownState = (dsChanged,dsFocused,dsUserAction);

Description

The TDropDownState type defines the possible values for the reason why the drop down list is about to appear.  This type gets passed as a parameter for the OnDropDown event and the DropDown method.

The possible values are described in the following table:

Value	Description
dsChanged	The text changed.
dsFocused	The control got focus.
dsUserAction	The user pushed the combo button.


OnCloseUp Event

TSearchNotifyEvent Type

Applies to

TIncCombo, TDBIncCombo, TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

property OnCloseUp: TNotifyEvent;

Description

The OnCloseUp event gets called right before the drop down list disappears.


History

Version 3.2

12/17/96 If GridParent is read only then set the control to read only.

Released 01/01/97

Version 3.1

12/10/96  Add new method CreateDropDown to help fix the problem with OnDropDown not firing with TDBIncLookupCombo and TDBIncSearchCombo.

12/11/96  FPW DropDown appearing behind Forms when FormStyle = fsStayOnTop.

12/12/96  Added property editors for LinkField and LinkIndex.

Released 12/12/96

Version 3.0

12/01/96  Fixed problem with drop down list sometimes dropping down as wide as the screen.

12/01/96  If DropDownOptions width = -1 then make the drop down list the size of the edit box.

Released 12/05/96

Version 2.9

11/21/96  In base class, fix problem with destructor raising an exception and causing a crash.

Released 11/21/96

Version 2.8

09/24/96  In TDBIncSearchCombo, ix problem with text not clearing after deleting the last record within a dataset.

10/02/96  In TDBIncCombo, when control is in a DBGrid, make sure the drop down list gets resized when the cell is resized.

10/07/96  In TDBIncCombo, fix possible GPF problem when DateField is blank.

10/18/96  Fixed problem with data-aware controls that are unbound and CanBeBlank is set to true when users exits a field that is blank, the control would reset the text value.

10/24/96  In TDBIncSearchCombo, fix problem with some of the complex parameter not getting set appropriately when connected to a TQuery.

10/28/96 In TDBIncLookupCombo and TDBIncSearchCombo, added partial support for ranges.

10/28/96 In TDBIncLookupCombo added OnValidateLocate to verify that a locate is within the range

10/28/96  In TDBIncLookupCombo and TDBIncSearchCombo, added OnValidateSearch to verify that a search is within the range

10/30/96  In TDBIncLookupCombo fix numerous problems when using FilteredSearch

10/30/96  In TDBIncLookupCombo and TDBIncSearchCombo, fix problem with drop down list taking a long time to appear with larger datasets.

11/06/96  In TDBIncLookupCombo and TDBIncSearchCombo, only create drop down grid when needed.  This reduces the number of handles and memory needed to use the controls.  This will also decrease the time the form takes to come up.

11/06/96  In all the controls when the control does not have focus and the edit box is to small to show the entire text, show the text from left to right.

11/06/96  Fixed problem with OnChange not getting called when a control is in a DBGrid.  This also fixes the problem with OnNewRecord not getting called appropriately when in a DBGrid.

11/07/96 In TDBIncLookupCombo and TDBIncSearchCombo, fix problem with possible Translate exception when searching on numbers and ExtendedSearch = True.

11/13/96 In TDBIncLookupCombo and TDBIncSearchCombo, start checking for LayoutChanged to reflect new changes. The specifically fixes the problem with TQuery master detail not working right.

11/13/96 In TDBIncLookupCombo,  changed LookupField to LinkField to make clearer.

11/13/96 In TDBIncLookupCombo,  added LinkIndex property to allow specification of the index to use during the datafield link.

Released 11/19/96

Version 2.7

08/26/96  Fixed the problem with the Enter key not causing the default action to take place if an IncCombo had focus.

09/05/96  In TDBIncLookupCombo and TDBIncSearchCombo, fixed some problems with MasterSource not working on the LookupSource dataset.  The program was trying to match an index to the MasterField which may or may not have existed in the LookupSource dataset by the same name.

09/05/96 Added support for filtering the DropDownList within TDBIncLookupCombo.  See FilteredSearch and OnFilteredSearch properties.

09/05/96 In TIncGrids, Fixed problem in GetColField that caused a GPF if grid did not

inherit from either TDBGrid or TwwDBGrid or InfoPower was not defined and it inherited from TwwDBGrid. Initially set Result = Nil.

Released 09/11/96

Version 2.6

08/22/96  In IncGrids, fixed some problems with accessing NIL pointers in GetSelectedField.

08/23/96  Fixed Closeup method so it only calls DoCloseUp method if the DropDown list is visible.

08/23/96 In TDBIncCombo and TDBIncLookupCombo, fixed the problem with record locking messages not showing up when the user tries to edit a locked record using the IncCombo controls.

08/23/96 In GridParent,  fixed the problem that only allowed you to select grids that were in the same window.  For example,  if the grid was located within a TPanel, the IncCombo control would also have to be located within that TPanel.

08/23/96 Made some changes to the Demo.

Released 08/25/96

 Version 2.5

08/21/96 In GridParent, fixed it so F2 will focus the attached IncCombo control.

08/21/96 Fixed the problem when running under Win 3.1 and the edit boxes are just a little to the left and down from the rest.

08/21/96 Fixed the problem of text getting clipped to the left and top when running a 16bit app under Win95 with small fonts.  This only occurs when the control does not have focus.

08/20/96 Demo added.

08/20/96 Fixed problem with GridParents Grid  not showing the attached control because TabStops for calculated columns are set by default to False.

08/19/96 Within TDBIncLookupCombo, If UnBound, then initially set the text to be the value in the LookupSource dataset.

08/19/96 Within TDBIncLookupCombo and TDBIncSearchCombo, start using SEQLocate when ExtendedSearch = True and LookupSource is a TQuery.  This fixes the problem with it not working under those conditions.

08/19/96 When using TQuery, locate without CaseSensitivity.

08/18/96 Fixed the problem with TDBIncSearchCombo not locating within the current range as denoted by the MasterSource and MasterFields properties.

08/19/96 Fixed the problem with the button not showing up in the right button face color when compiled under Delphi 1.0.

Released 08/21/96

Version 2.4

08/15/96 Added Visible property to GridParent.

08/15/96 Fixed a problem when using GridParent and scrolling horizontally and the IncCombo control does not repaint appropriately.

08/15/96 Changed the resource file names to be more specific to reduce conflict.

Released 08/15/96

Version 2.3

08/10/96  Made the TDBIncLookupCombo unbounded.  Allows the control to work without a DataSource or DataField.

08/10/96  Added support for MasterSource and MasterFields.

08/14/96 If the parent of an IncCombo control is a TCustomGrid and the control is not focused then highlight the entire edit window.

Released 08/14/96

Version 2.2

07/30/96 Fixed some problems with button getting clipped when font is changed.

07/30/96 Fixed problem created in version 2.1 with tabs not working when control is outside of a grid.

07/30/96 When the user backspaces beyond the first character, the control will no longer go to the top of the list or beginning of record.

08/01/96 Added new property CanBeBlank.  The property will allow a blank field to be valid.  In the case of a DataAware control, it will set the field to Null.

08/02/96 In TDBIncSearchCombo and TDBIncLookupCombo we no longer highlight a row within the drop down grid if the user is adding a new item.

08/02/96 In TDBIncLookupCombo fix the problem that existed when the user entered a new value and then dropped down the list and the value was reset to an existing value.

08/02/96 In TDBIncSearchCombo and TDBIncLookupCombo start passing the NewValue as a parameter of OnNewRecord.

08/02/96 In TDBIncSearchCombo start passing LookupSource as the dataset i.o BufferedLookupSource when calling OnNewRecord.

08/02/96 In TDBIncSearchCombo fix the problem that existed when AutoInsert = True and the user aborts from OnNewRecord and the edit field goes blank.

08/02/96 In TDBIncSearchCombo after OnNewRecord is called, resync the internal buffer to match the new value in LookupSource.

Internally Released 08/02/96

Version 2.1

07/29/96 Added grid awareness to all controls.  See FloatOverGrid method.

07/29/96 Added hooks into TDBGrid and TwwDBGrid (InfoPower) for the TDBIncCombo and the TDBIncLookupCombo component.  See GridParent property.

07/29/96 Added SQL support for Delphi 1.0.  See the TDBIncLookupCombo and the TDBIncSearchCombo component.

Internally Released 07/29/96

Version 2.0

06/30/96 Fixed problem with TIncCombo and TDBIncCombo when Style = TIncSearchEdit and user types in a new value and then hits either the up or down arrow key and gets an index out of bounds error.

07/03/96 In all controls when the user hits ESC, reset the edit value back to the original value.

07/03/96 In TDBIncSearchCombo, when AutoInsert = False, fix the problem that occurs if you have a message assigned to BeforeCancel for the LookupSource and it continually gets displayed after every keystroke.  Basically we no longer call cancel after every KeyStroke when entering a new value.  We also recognize the situation where the control caused the record to go into edit mode and AutoSuppressCancel = True.

07/03/96 In the evaluation copy of the Incremental Combo Collection, only display evaluation message once and make it none disruptive to the application flow.

07/03/96 Within TDBIncCombo and TDBIncLookupCombo if placing the DataSource into edit mode fails, reset value back to its original value.

07/03/96 Within TDBIncSearchCombo if placing the LookupSource into edit or insert mode fails, reset value back to its original value.

Released 07/16/96

Version 1.9

06/19/96 Fixed problem with changing the font size of the control and causing the combo button to get overwritten.

06/19/96 Fixed problem with combo button getting clipped by text when there is no border or the control is not 3D.

06/19/96 Added a new event, OnDropDown, for when the drop down list appears.

06/19/96 Added a new event, OnCloseUp, for when the drop down list disappears.

06/19/96 In TDBIncSearchCombo, fix problem that prevented user from inserting new records externally.

06/19/96 In all controls, start allowing the drop down list to appear even if empty.

06/19/96 In TIncCombo fix problem that occurs when OnNewItem is not assigned and a user clicks into the control and cant get out without typing a valid item from the list.

06/19/96 Fixed problem with drop down list not appearing if the user clicks on the combo button and AutoDropDown = adFocused.

06/19/96 CanDropDown method will no longer be affected by whether or not there are items in the drop down list.

06/19/96 The combo button appearing disabled in 32Bit will no longer be affected by whether or not there are items in the drop down list.

06/19/96 Fixed problem in TDBIncLookupCombo when trying to locate the DataField in the LinkField and DataFields actual value is blank.  This happens when you insert a new record and the DataField is not a string type field.

06/21/96 When there is no border, offset text top and left by 2 so that it aligns better within grids.

06/21/96 In TIncCombo and TDBIncCombo when the user sets ItemIndex to -1, always clear the text.

06/24/96 In Delphi 16bit, changed formula for drawing combo button.

Released 06/25/96

Version 1.8

06/11/96  Fixed problem in 32 bit with TQuery not working as the LookupSource in TDBIncLookupCombo.

06/11/96  Made About box declaration less generic to remove any conflicts with other controls.

06/13/96 Within TDBIncSearchCombo and TDBIncLookupCombo, fix problem with calculation of the width of the drop down list  If DropDownOptions.Width = 0.

06/13/96 Check for horizontal clipping of the drop down list and realign as needed.

06/13/96 Within TDBIncSearchCombo and TDBIncLookupCombo, fix problem with TQuery not being uniquely indexed and causing an exception when user tries to drop down the list.

Released 06/13/96


GridParent Property

Applies to

TDBIncCombo Component,  TDBIncLookupCombo Component components

Declaration

 property GridParent: TIncGridParent;

Description

The GridParent property lets you specify a Borland TDBGrid or an InfoPower TwwDBGrid that you would like this control to appear in automatically. If the grid you wish to place the control is an InfoPower TwwDBGrid, you must define INFOPOWER. {$DEFINE INFOPOWER}

For best results, set the BorderStyle = bsNone and Ctl3D = False.

NOTE: All Incremental controls are grid aware and can manually be placed in a grid through  code modifications to the Grid source code.  See the FloatOverGrid method or InfoPower TwwDBGrid.


TIncGridParent Object

Properties

Unit

IncMisc

Description

The TIncGridParent object defines the attributes of the GridParent property for a TDBIncCombo or a TDBIncLookupCombo.

This object establishes the relationship between the incremental control and the grid in which in will automatically be placed.  If the grid you wish to place the control is an InfoPower TwwDBGrid, you must define INFOPOWER. {$DEFINE INFOPOWER}


TIncGridParent Properties
Properties

	AlwaysShowingEditing
	Field
	Grid
	Visible


AlwaysShowEditing Property

Applies to

TIncGridParent

Declaration

 property AlwaysShowEditing: TAlwaysShowEditing;

Description

The AlwaysShowEditing property is used to determine when the Incremental control will get focus within a grid.


Field Property

Applies to

TIncGridParent

Declaration

  property Field: String;

Description

The Field property determines the database field that corresponds to the grid column you would like the attached Incremental control placed automatically.  Along with the Grid property the Incremental control will float itself within a Borland TDBGrid or an InfoPower TwwDBGrid. If the grid you wish to place the control is an InfoPower TwwDBGrid, you must define INFOPOWER. {$DEFINE INFOPOWER}


Grid Property

Applies to

TIncGridParent

Declaration

  property Grid: TCustomGrid;

Description

The Grid property determines the grid to place the attached Incremental control into automatically.  Along with the Field property, the Incremental control will float itself within a Borland TDBGrid or an InfoPower TwwDBGrid. If the grid you wish to place the control is an InfoPower TwwDBGrid, you must define INFOPOWER. {$DEFINE INFOPOWER}


TAlwaysShowEditing Type

Unit

IncMisc

Declaration

type

  TAlwaysShowEditing = (seAuto,seFalse,seTrue);

Description

The TAlwaysShowEditing type defines the possible values for the AlwaysShowEditing property of the TIncGridParent object.  These types determine when the Incremental control will get focus within a grid.

The possible values are described in the following table:

Value	Description
seAuto	The connected Grid options property will determine when this control gets focus. See the dgAlwaysShowEditor property.
seTrue	The control will always get focus when the user tabs into the Grid cell.


InfoPower

Currently there are two ways to place an IncCombo within an InfoPower TwwDBGrid. The first and easiest way is to use the GridParent property.  The second way is to make code modification to InfoPower version 2.0.  The only real advantage to do the code modification is to allow InfoPower to work with any TCustomEdit.

If the you wish to use the GridParent property, you must define INFOPOWER. {$DEFINE INFOPOWER}

The following code modifications will make InfoPower grids more generic and will expand it to support any TCustomEdit.  Please keep in mind that in order for a control to function properly within a grid, it must also be grid aware.  The IncCombo controls are grid aware and should work fine after the following code modification.  For the sake of maintaining copyrights, these code modifications will be limited to only the changes needed.

Code modifications in Bold.

PLEASE NOTE:  This information is provided for your assistance and protected by the terms of the License Agreement and should be treated as CopyRighted material.  Basically, we just dont want you to start publishing this information without our permission.

Within wwSelFld.PAS.

function wwSelectTableFields(dataSet: TDataSet;  var fields: TStrings;  Designer:  TFormDesigner): Boolean;

…

…

if (component is TwwDBCustomEdit) or (component is TwwDBCustomLookupCombo)

or (component is TCustomEdit) then

DBLookupComboList.items.add(component.name)

…

…

end;

Within wwDBGrid.PAS.

procedure TwwDBGrid.DrawCell(ACol, ARow: Longint; ARect: TRect;  AState: TGridDrawState);

…

…

if not CurrentCustomEdit.InheritsFrom(TCustomEdit)

or  CurrentCustomEdit.InheritsFrom(TwwDBCustomEdit) then

  { This is here for screen repainting reasons, otherwise screen is painted wrong then right. }

currentCustomEdit.Text:= Value;

…

…

end;

Function TwwDBGrid.GetControlDataSource(ctrl: TWinControl): TDataSource;

var PropInfo: PPropInfo;

begin

{ Replace all the code within this function }

Result := Nil;

PropInfo := TypInfo.GetPropInfo(ctrl.ClassInfo,'DataSource');

if (PropInfo <> nil) and (PropInfo^.PropType^.Kind = tkClass) then

Result := TObject(GetOrdProp(ctrl,PropInfo)) as TDataSource;

end;

Function TwwDBGrid.GetControlDataField(ctrl: TWinControl): string;

var PropInfo: PPropInfo;

begin

{ Replace all the code within this function }

Result := '';

PropInfo := TypInfo.GetPropInfo(ctrl.ClassInfo,'DataField');

if (PropInfo <> nil) and (PropInfo^.PropType^.Kind = tkString) then

Result := GetStrProp(ctrl,PropInfo);

end;

Procedure TwwDBGrid.SetControlDataSource(ctrl: TWinControl; ds: TwwDataSource);

var PropInfo: PPropInfo;

begin

{ Replace all the code within this function }

if not Ctrl.InheritsFrom(TCustomEdit)

or Ctrl.InheritsFrom(TwwDBCustomEdit) then

begin

PropInfo := TypInfo.GetPropInfo(ctrl.ClassInfo,'DataSource');

if (PropInfo <> nil) and (PropInfo^.PropType^.Kind = tkClass) then

 SetOrdProp(ctrl,PropInfo,LongInt(ds));

end;

end;

Procedure TwwDBGrid.SetControlDataField(ctrl: TWinControl; df: string);

var PropInfo: PPropInfo;

begin

{ Replace all the code within this function }

if not Ctrl.InheritsFrom(TCustomEdit)

or Ctrl.InheritsFrom(TwwDBCustomEdit) then

begin

PropInfo := TypInfo.GetPropInfo(ctrl.ClassInfo,'DataField');

if (PropInfo <> nil) and (PropInfo^.PropType^.Kind = tkString) then

 SetStrProp(ctrl,PropInfo,df);

end;

end;


FloatOverGrid Method

Applies to

TIncCombo, TDBIncCombo, TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

  procedure FloatOverGrid(Rect: TRect; Focus: Boolean);

Description

The FloatOverGrid method will set the Incremental controls origin to the same as the Rect   parameter.  The focus parameter determines whether or not to focus the Incremental control. All of the Incremental controls will look to see if they are children of TCustomGrid and act accordingly.  You can optionally set GridParent property to automatically place the control within a Borland TDBGrid or an InfoPower TwwDBGrid.


CanBeBlank Property

Applies to

TIncCombo, TDBIncCombo, TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

property CanBeBlank: Boolean;

Description

The CanBeBlank property is used to determine if a blank entry is valid.  In the case of a DataAware control, the field will get set to Null.


Visible Property

Applies to

TIncGridParent Object  object

Declaration

property Visible: Boolean;

Description

The Visible property is used to determine if the IncCombo control is visible within the Grid of the GridParent.


Installation

In Delphi 2.0

Go into Delphi and select Component:Install…  from the menu and select the Add button.  After that, select the Browse button and locate the file IncReg.PAS located in the 32Bit directory.  Select the file by either double clicking or pressing the Open button.  After that, you should be back at the Install Components windows where you can press the OK button to finish.

In Delphi 1.0

Go into Delphi and select Options:Install Components…  from the menu and select the Add button.  After that, select the Browse button and locate the file IncReg.PAS located in the 16Bit directory.  Select the file by either double clicking or pressing the OK button.  After that, you should be back at the Install Components windows where you can press the OK button to finish.

After installing the components you should have a new tab on your components pallete called IncCombos that contain your new components.

Good Luck and have fun.  If you need any assistance or have any comments, please contact us at the following addresses;

CIS:102565,2117 or 102565.2117@compuserve.com

http://ourworld.compuserve.com/homepages/softouchdev

Softouch Development Inc.

12320 S.W. 128 Street

Tigard, Oregon 97223


FilteredSearch Property

Applies to

TDBIncLookupCombo components

Declaration

 property FilteredSearch: Boolean;

Description

The FilteredSearch property along with the OnFilteredSearch event allows you to filter the values used when doing incremental searches either by typing or by dropping down the list.  This property is most commonly used when values within the drop down list are not longer available for selecting but can still be used to get the display value of any records that are still using their code.


OnFilteredSearch Event

Applies to

TDBIncLookupCombo

Declaration

property OnFilteredSearch: TFilteredSearchEvent;

Description

The OnFilteredSearch event gets called for each record in the LookupSource dataset as it is retrieved. Using this event you can choose which record to keep by setting the Accept variable to True to keep it and False to deny it.

To retrieve the fields within the filtered table while in the OnFilteredSearch event, you must use the FilteredFieldByName method.  This only applies within the OnFilteredSearch event.  All other times you can use the normal Borland method Dataset.FieldByName.


FilteredFieldByName Method

Applies to

TDBIncLookupCombo

Declaration

  function FilteredFieldByName(AFieldName: string): TParam;

Description

The FilteredFieldByName method is used to retrieve the field information for the field name passed in the AFieldName parameter.  This function is only valid within the OnFilteredSearch event.


TFilteredSearchEvent Type

Unit

IncDBLup

Declaration

type 	TFilteredSearchEvent = procedure(Sender: TCustomDBIncLookupCombo; var Accept: Boolean) of object;

Description

The TFilteredSearchEvent type defines the event type for doing filtered searches while incrementally typing or dropping down the lookup list within a TDBIncLookupCombo.

To retrieve the fields within the filtered table while in an event of this type, you must use the FilteredFieldByName method.  This only applies within the events of this type.  All other times you can use the normal Borland method Dataset.FieldByName.


Methods

	CanDropDown	Create	DropDownList
	CanModify	Destroy	FilteredFieldByName
	CloseUp	DropDown	FloatOverGrid


OnNewRecord Example

{ This is an example for a TDBIncLookupCombo

In this example,

DataSource contains orders.

LookupSource contains the customers.

DataField = CustNo

LinkField = Company Number

}

procedure TForm.DBIncLookupComboNewRecord(Sender: TObject;

  DataSet: TDataSet; NewValue: string);

begin

{ First you must create the new record }

DataSet.Insert;

{ You will need to generate this number somewhere }

DataSet.FieldByName('Company Number').AsInteger := 999;

DataSet.FieldByName('Company Name').AsString := NewValue;

DataSet.Post;

{ Then you must tell the DataSource:DataField what the new link value is }

with TDBIncLookupCombo(Sender) do

{ This number should be the same number used above }

DataSource.DataSet.FieldByName(DataField).AsInteger := 999;

end;

{ This is an example for a TDBIncSearchCombo

In this example,

LookupSource contains customers.

}

procedure TForm.DBIncSearchComboNewRecord(Sender: TObject;

  DataSet: TDataSet; NewValue: string);

begin

DataSet.Insert;

{ You will need to generate this number somewhere }

DataSet.FieldByName('Company Number').AsInteger := 999;

DataSet.FieldByName('Company Name').AsString := NewValue;

DataSet.Post;

end;


LinkIndex Property

Applies to

TDBIncLookupCombo component.

Declaration

 property LinkIndex: String;

Description

The LinkIndex property determines the index used when linking the DataField to the LinkField.  This property is only valid when LookupSource dataset inherits from TTable.

NOTE:  You only need to set this field if you have some specialized indexing needs.  If left blank, the control will look for an index that starts with the LinkField property.


OnValidateLocate Event

Applies to

TDBIncLookupCombo

Declaration

property OnValidateLocate: TValidateEvent

Description

The OnValidateLocate event gets called while trying to link the DataField to the LinkField for each record retrieved. Using this event you can choose which record to keep by setting the Accept variable to True to keep it and False to deny it.

This event has no effect on which items appear in the drop down list.  To restrict the items in the drop down list, see FilteredSearch property.

This event is mainly used when setting ranges on an index.  See Ranges.


OnValidateSearch Event

Applies to

TDBIncLookupCombo, TDBIncSearchCombo components

Declaration

property OnValidateSearch: TValidateEvent

Description

The OnValidateSearch event gets called while incrementally looking up values in the drop down list. Using this event you can choose which record to keep by setting the Accept variable to True to keep it and False to deny it.

This event has no effect on which items appear in the drop down list.  To restrict the items in the TDBIncLookupCombos drop down list, see FilteredSearch property.

This event is mainly used when setting ranges on an index.  See Ranges.


TValidateEvent Type

Unit

IncDBLup

Declaration

type 	TValidateEvent = procedure(Sender: TObject; DataSet: TDataSet; SearchText: String; var Accept: Boolean) of object;

Description

The TValidateEvent type defines the event type for accepting or denying records during a OnValidateLocate or and OnValidateSearch event.


Ranges

In order to use a range effectivelly on a LookupSource dataset, you must set the range as you would normally on the LookupSource and then call the NewRange method if the control is a TDBIncSearchCombo.   Where we get into trouble is when we change the index to do the lookups.  Ranges are only effective on the index they where set on.  To fix this problem we have created two new events.  Those events are OnValidateLocate (TDBIncLookupCombo only) and OnValidateSearch.   Within these events, it will be your job to make sure the range criteria is meet by either accepting or denying the record.


TDBIncSearchCombo Methods
Methods

	CanDropDown	Create	DropDownList
	CanModify	Destroy	FloatOverGrid
	CloseUp	DropDown	NewRange


NewRange Method

Applies to

TDBIncSearchCombo

Declaration

  procedure NewRange;

Description

The NewRange method is used to tell the TDBIncSearchCombo that it needs to rebuild its buffered table.  This usually needs to get called when something changes the LookupSource range and the internal buffered table needs to reflect the changes.